#include <iostream>
using namespace std;
/*
对象型参数和返回值
使用对象型作为函数的参数和返回值，可能会产生不必要的中间对象
*/
class Point
{

public:
    Point() // 无参构造
    {
        cout << "Point()" << endl;
    }
    Point(const Point & obj)
    {
        cout << "Point(const Point & obj)" << endl;
    }
    ~Point() // 析构函数
    {
    }

public:
    void getsomething()
    {
        cout << "getSomething" << endl;
    }

private:
    /* data */
};

Point test(Point point)
{
    Point res;
    return res;
}



int main()
{
    Point p1;
    //Point p2(p1);
    //Point p3 = p2;
    Point res =test(p1);
    return 0;
}